$("#searchBtn").on('click', function () {
  let doctorName = $("#doctorname").val();
  let doctorJob = $("#doctorJob").val();
  let sex = $("#sex").val();
  // console.log("doctorname=",doctorname)
  // console.log("doctorJob=",doctorJob)

  // console.log("sex=",sex)

  doctorName = doctorName.trim();
  doctorJob = doctorJob === null ?"":doctorJob;
  sex = sex === null?"":sex;
  // console.log("doctorname=",doctorname)
  // console.log("doctorJob=",doctorJob)

  // console.log("sex=",sex)
 if(doctorName.length === 0 && doctorJob.length===0 && sex.length === 0){
  alert('必须有一个条件')
  return;
 }
  $.ajax({
    url:"/doctor/search",
    type:'post',
    data: {doctorName,doctorJob,sex},
    success(res){
      if(res.code === 0){
        console.log(res.data)
      }else{
        alert(res.msg)
      }
    }
  })

})